Chris Pollett >
Old Classes
> |
HW#4 --- last modified January 01 1970 00:00:00..Due date: Nov 18
Files to be submitted: Purpose: To gain practice with concurrency and serializability concepts. To write a few transactions that have commit and rollback's and to do experiments with them. Specification: Do problems 19.23 and 19.24 out of the book and submit them in Problems.zip. For the programming part of the assignment you will write two transactions but rewrite them using three different techniques for talking to an Oracle DB: using JDBC, using SQLJ, and in C using embedded SQL. Your goal will then be to do some experiments with your programs. The JDBC program should make non-trivial use of PreparedStatement. Your transactions will perform their operations on the following table:
CREATE TABLE COUNTER This table will initially only be populated with one row: (0, 0). Both your transactions update the row. The first transaction reads firstDigit, adds one to it, and updates the row with this new value. If firstDigit is less than 10 after the increment the transaction commits. If firstDigit, however, is a 10 it sets it to 0 and updates. In this case, it then reads secondDigit. If second digit is less than 9 it then increments second digit and update the row again and commit. If secondDigit is a 9 the transaction is rolled back. The second transaction is like the first except it tries to decrement the two digit number. That is, if firstDigit is bigger than 0 subtract 1 from it, update, and commit. If the firstDigit is a 0 change it to a 9 update the row, and read the secondDigit. If this is bigger than 0 decrement 1 from it update, and commit. Otherwise, rollback.
Given these two transactions you need to : Your experiments and results should be in the file code.zip. This file should contain a readme.txt file explaining how using the programs in code.zip to replicate your experiments. It should also contain a file output.txt which contains a print-out of the output of all your experiments together with commentary on your results. Point Breakdown
|